const mongoose = require('mongoose')

/*
    商品对象
        图片列表
        标题
        价格
        库存
        商品详情(wangEdit)


    banners: Array,
    title: String,
    price: Number,
    count: Number,
    detail_html: String,

    "banners": [
        "http://localhost:8081/imgs/1.jpg",
        "http://localhost:8081/imgs/2.jpg",
        "http://localhost:8081/imgs/3.jpg",
        "http://localhost:8081/imgs/4.jpg",
        "http://localhost:8081/imgs/5.jpg",
    ],
    "title": "",
    "price": 100.01,
    "surplus": 99,
    "detail_html": "123"
*/
const CommoditySchema = mongoose.Schema({
    banners: Array,
    title: String,
    price: Number,
    surplus: Number,
    detail_html: String,
    isDelete: { type: Boolean, default: false }
})

const Commodity = mongoose.model('commodity', CommoditySchema)

module.exports = Commodity
